<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php 
    echo $this->headMeta()."\n";
    echo $this->headTitle()."\n";
    
    echo $this->headScript()->appendFile($this->baseUrl().'/js/library/jquery-1.7.2.min.js')
    	->appendFile($this->baseUrl().'/js/library/jquery.easyui.min.js')
    	->appendFile($this->baseUrl().'/js/logout.js');
    ?>
</head>
<body>
	<form action="<?php echo $this->baseUrl()?>/manager" method="post">
	<table border="0" width="100%">
	<tbody>
		<tr bgcolor="#F0F0F0">
			<td width="20%" height="40" align="center">上级分类</td>
			<td width="80%" style="padding-left:10px;">
				<select name="id">
				<?php foreach($this->tree as $row):?>
				<option value="<?php echo $row['id']?>"><?php echo $row['treeText']?></option>
				<?php endforeach;?>
				</select>
			</td>
		</tr>
		<tr bgcolor="#F0F0F0">
			<td width="20%" height="40" align="center">分类名称</td>
			<td width="80%" style="padding-left:10px;">
				<input type="text" name="cat_name" style="width:200px;" />
			</td>
		</tr>
		<tr bgcolor="#CCCCCC">
			<td colspan="2" align="center" height="40">
				<input type="submit" value="添加分类" />
			</td>
		</tr>
	</tbody>
	</table>
	</form>

	<table border="0" width="100%" style="margin-top:20px;">
	<tbody>
		<tr bgcolor="#CCCCCC">
			<th width="10%" height="40">ID</th>
			<th width="80%">树结构</th>
			<th width="10%">操作</th>
		</tr>
		<?php foreach($this->tree as $row):?>
		<tr bgcolor="#F0F0F0">
			<td align="center" height="40"><?php echo $row['id']?></td>
			<td align="left" style="padding-left:10px;"><?php echo $row['treeText']?></td>
			<td align="center">
			<a href="<?php echo $this->baseUrl()?>/manager/index/index/id/<?php echo $row['id']?>/d/delete">删除</a>
			</td>
		</tr>
		<?php endforeach;?>
	</tbody>
	</table>
</body>
</html>